import Vue from 'vue'
import App from './App'
import i18n from './lang/index'

Vue.config.productionTip = false


import GoEasy from "./node_modules/goeasy/goeasy.min.js";
const goEasy = GoEasy.getInstance({
    host:'hangzhou.goeasy.io',
    appkey: 'BC-4a2312c3a7b14388bedef3bae76669e6',
    // true表示支持通知栏提醒，false则表示不需要通知栏提醒
    allowNotification:true, //仅有效于app,小程序和H5将会被自动忽略
    modules:["im"]
});

Vue.prototype.GoEasy = GoEasy;
Vue.prototype.goEasy = goEasy;

App.mpType = 'app'
Vue.filter('dominaImg',(url)=>{
	if (url) {
	  return url.indexOf('http') > -1 ? url : ('http://dl.hgtplat.com/' + url);
	}else{
	   return 'http://dl.hgtplat.com/banjo/picture/Fplaceholder1.png'
	}
})
Vue.filter('filterNull',(param)=>{
	if (!param || param == null) {
	  return '';
	} else {
	  return param;
	}
})

Vue.prototype.formatDate = function (t) {
    t = t || Date.now();
    let time = new Date(t);
    let str = time.getMonth() < 9 ? ('0' + (time.getMonth() + 1)) : (time.getMonth() + 1);
    str += '-';
    str += time.getDate() < 10 ? ('0' + time.getDate()) : time.getDate();
    str += ' ';
    str += time.getHours();
    str += ':';
    str += time.getMinutes() < 10 ? ('0' + time.getMinutes()) : time.getMinutes();
    return str;
}
Vue.prototype._i18n = i18n
const app = new Vue({
	i18n,
    ...App
})
app.$mount()
